package com.github.pig.admin.service.task;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.github.pig.admin.model.zhgl.houseowner.HouseOwner;
import com.github.pig.admin.service.zhgl.house.IUnitHouseService;
import com.github.pig.admin.service.zhgl.houseowner.IHouseOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class TaskService {
    @Autowired
    private  IUnitHouseService houseService;
    @Autowired
    private IHouseOwnerService ownerService;


    /**
     * 每天1点执行，更新房屋状态（租赁房屋）
     */
    @Scheduled(cron = "0 0 1 * * ?")
    public void updateHouseStatus(){
        //查询租赁到期住户
        List<HouseOwner> houseOwnerList = getOverdueHoseOwner();
    }

    private List<HouseOwner> getOverdueHoseOwner() {
        EntityWrapper entityWrapper = new EntityWrapper();
        entityWrapper.lt("lease_date_end","SYSDATE()");
        entityWrapper.eq("del_flag","0");
        return null;
    }
}
